Since the execution of stop_machine_run() via cpu_down() is now always
deferred to a hypercall continuation context, the above locks are not
held at that time. Hence the trylock is not specifically to avoid
deadlock with stop_machine_run(), but rather a more general paranoia
about deadlocks in general.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
if ( op->interface_version != XENPF_INTERFACE_VERSION )
return -EACCES;
- /* spin_trylock() avoids deadlock with stop_machine_run(). */
+ /*
+ * Trylock here avoids deadlock with an existing platform critical section
+ * which might (for some current or future reason) want to synchronise
+ * with this vcpu.
+ */
while ( !spin_trylock(&xenpf_lock) )
if ( hypercall_preempt_check() )
return hypercall_create_continuation(
if ( op->interface_version != XEN_SYSCTL_INTERFACE_VERSION )
return -EACCES;
- /* spin_trylock() avoids deadlock with stop_machine_run(). */
+ /*
+ * Trylock here avoids deadlock with an existing sysctl critical section
+ * which might (for some current or future reason) want to synchronise
+ * with this vcpu.
+ */
while ( !spin_trylock(&sysctl_lock) )
if ( hypercall_preempt_check() )
return hypercall_create_continuation(